<template>
</template>

<script>
const app = getApp();
	export default{
		onLoad(option) {
			let that =this
			uni.chooseLocation({
				latitude:option.latitude,
				longitude:option.longitude,
				name:'',
				address:option.address,
			    success: function (res) {
			        app._log('位置名称：' + res.name);
			        app._log('详细地址：' + res.address);
			        app._log('纬度：' + res.latitude);
			        app._log('经度：' + res.longitude);
					
						let {name,address,latitude,longitude} = res
					    var pages = getCurrentPages();
					    var prepage = pages[pages.length - 2]; //上一个页面
					    prepage.$vm.addressName = name
					    prepage.$vm.address = address
					    prepage.$vm.latitude = latitude
					    prepage.$vm.longitude = longitude
			    },
				fail:function(){
				},
				complete:function(){
					app._log("complete")
					uni.navigateBack()
				}
			});
		}
	}
</script>

<style>
</style>
